<%@ tag description="Allows to link two issues" pageEncoding="UTF-8" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ attribute name="issueClass" type="java.lang.Class" required="true" %>
<%@ attribute name="linkClass" type="java.lang.Class" required="true" %>
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<c-rt:set var="subsession_id" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE %>" />
<c-rt:set var="subsession_path" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE_PATH %>" />
<input id="linkParentIssue" name="linkParentIssue" type="hidden" />
<input id="linkParentIssueAlias" name="linkParentIssue" type="hidden" />
<input id="linkParentProject" name="linkParentProject" type="hidden" />
<div style="width:450px">
    <iwebmvc:enum id="newlink" entityClass="${linkClass}" path="type" rows="5" />
    <iwebmvc:locator id="newlink" gridId="newlinkLocatorGrid" entityClass="${linkClass}" path="target" baseColumnWidth="100" currentDepthLevel="0" rows="10" pages="5" />
</div>
<div style="width:450px;padding-top:5px;text-align:right">
    <span id="issueLinkValidationWarningContainer" class="validationWarning"></span>
    <span id="issueLinkLoadingContainer" style="display:none"><img src='<c:url value="resource.iwebmvc?file=images/loading.gif" />&${requestScope[subsession_path]}=${requestScope[subsession_id]}' alt='' /></span>
    <iwebmvc:button buttonId="newIssueLinkButton" label="ui.issue.actions.developer.link.save" buttonIcon="/resource.iwebmvc?file=/images/common/chain_${sessionScope[sessionUser].theme}.gif">
        linkIssue('${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}', byId("linkParentIssue").value, byId("targetnewlink").value, dijit.byId("typenewlink").getValue(), byId("linkParentIssueAlias").value, "<iwebmvc:message argMessage="ui.issue.main.tabs.Links" />", "<iwebmvc:message argMessage="ui.issue.link.this;x" />", "<iwebmvc:message argMessage="ui.issue.link.other" />", dijit.byId("targetnewlink0").getValue(), dijit.byId("typenewlink").getDisplayedValue());
    </iwebmvc:button>
</div>